﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MosquePortal.Web.Models;

namespace MosquePortal.Web.Controllers
{
    public class FridaySpeechController : Controller
    {
        static FridaySpeechModel[] data=  new FridaySpeechModel[]{
                new FridaySpeechModel(){
                    ID=1,
                     Author="رامي غنامة",
                      Date=DateTime.Now,
                       Title="تجنب فتنة المساجد"

                },
                new FridaySpeechModel(){
                    ID=2,
                     Author="رامي غنامة",
                      Date=DateTime.Now,
                       Title="تجنب فتنة المساجد"

                },
                new FridaySpeechModel(){
                    ID=3,
                     Author="رامي غنامة",
                      Date=DateTime.Now,
                       Title="تجنب فتنة المساجد111"

                },
                new FridaySpeechModel(){
                    ID=4,
                     Author="رامي غنامة2222",
                      Date=DateTime.Now,
                       Title="تجنب فتنة المساج2222د"

                },
                new FridaySpeechModel(){
                    ID=5,
                     Author="رامي غنامة111112222",
                      Date=DateTime.Now,
                       Title="تجنب فتنة المساج1111112222د"

                }
        };
        //
        // GET: /FridaySpeech/

        public ActionResult Index()
        {
            ViewData["Data"] = data;
            
            return View();
        }

        //
        // GET: /FridaySpeech/Details/5

        public ActionResult Details(int id)
        {
            return View("Details", data.Where(a => a.ID == id).Single());
        }

        //
        // GET: /FridaySpeech/Create

        public ActionResult Create()
        {
            return View();
        } 

        //
        // POST: /FridaySpeech/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        
        //
        // GET: /FridaySpeech/Edit/5
 
        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /FridaySpeech/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /FridaySpeech/Delete/5
 
        public ActionResult Delete(int id)
        {
            return View();
        }

        //
        // POST: /FridaySpeech/Delete/5

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
    }
}
